/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package thread;

import java.net.DatagramPacket;
import java.net.InetAddress;
import java.util.ArrayList;

/**
 *
 * @author hoangvukenshinPC
 */
public class Upload_Thread extends Thread
{
    private DatagramPacket RequestPacket;
    Upload_Core uc;
    byte[] data;
    InetAddress dest;
    
    public Upload_Thread(DatagramPacket requestpacket) 
    {        
        this.RequestPacket = (requestpacket);
        data = RequestPacket.getData();
        dest = RequestPacket.getAddress();
    }
    @Override
    public void run() {
        uc = new Upload_Core(data, dest);
        try
        {
            uc.start();
           // uc.join();
        }
        catch (Exception ex)
        {
        
        }
       
        
    }

    /**
     * @return the RequestPacket
     */
    public DatagramPacket getRequestPacket() {
        return RequestPacket;
    }

    /**
     * @param RequestPacket the RequestPacket to set
     */
    public void setRequestPacket(DatagramPacket RequestPacket) {
        this.RequestPacket = RequestPacket;
    }
    
    
    
}
